<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人资料修改</title>
    <link rel="stylesheet" href="<?=userassets?>component/pear/css/pear.css" />
    <link rel="stylesheet" href="<?=userassets?>css/info.css?v=<?=time()?>" />
    
</head>
<body>
    <div class="mainBox">
        <form class="layui-form">
        <div class="section-block">
            <div class="section-title">
                基础信息<span class="subtitle">账号个人信息</span>
            </div>
            
            <div class="profile-box">
                <div class="avatar-section">
                    <div class="avatar-box">
                        <img src="/assets/img/BiazfanxmamNRoxxVxka.png" >
                        
                        
                    </div>
                </div>
                <div class="form-section">
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block ">
                            <input type="text" value="<?=$this->userrow['user']?>" readonly autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label required">QQ</label>
                        <div class="layui-input-block">
                            <input type="text" name="qq"  placeholder="请输入QQ" value="<?=$this->userrow['qq']?>" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    
                </div>
            </div>
        </div>
        <div class="section-block">
            <div class="section-title">
                联系方式
                <span class="subtitle">绑定您的联系方式</span>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">邮箱</label>
                <div class="layui-input-block input-group">
                    <input type="text" id="email" readonly placeholder="邮箱" 
                           value="<?=$email?>" autocomplete="off" class="layui-input">
                    <div class="edit-btn" onclick="showVerifyDialog('email')">
                        <i class="layui-icon layui-icon-edit"></i>
                        <span><?= empty($this->userrow['email'])?'绑定':'修改'; ?></span>
                    </div>
                </div>
            </div><div class="layui-form-item">
                <label class="layui-form-label required">手机号</label>
                <div class="layui-input-block input-group">
                    <input type="text" id ="phone" readonly placeholder="手机号" 
                           value="<?=$phone?>" autocomplete="off" class="layui-input">
                    <div class="edit-btn" onclick="showVerifyDialog('phone')">
                        <i class="layui-icon layui-icon-edit"></i>
                        <span><?= empty($this->userrow['phone'])?'绑定':'修改'; ?></span>
                    </div>
                </div>
            </div>
        </div>
        <div class="section-block">
            <div class="section-title">
                密码管理
                <span class="subtitle">修改密码</span>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">密码</label>
                <div class="layui-input-block input-group">
                    <input type="text" id="pass" readonly placeholder="密码" 
                           value="<?=$pwd?>" autocomplete="off" class="layui-input">
                    <div class="edit-btn" onclick="showVerifyDialog('pass')">
                        <i class="layui-icon layui-icon-edit"></i>
                        <span>修改</span>
                    </div>
                </div>
            </div><div class="layui-form-item">
                <label class="layui-form-label required">支付密码</label>
                <div class="layui-input-block input-group">
                    <input type="text" id ="pay_pass" readonly placeholder="支付密码" 
                           value="<?=$paypass?>" autocomplete="off" class="layui-input">
                    <div class="edit-btn" onclick="showVerifyDialog('pay_pass')">
                        <i class="layui-icon layui-icon-edit"></i>
                        <span>修改</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="section-block">
            <div class="section-title">
                支付设置
                <span class="subtitle">支付通用设置</span>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label">支付宝免输模式</label>
                <div class="layui-input-block">
                    <select name="INPUTFREE" default="">
                           <option value="3" <?=$this->userrow['INPUTFREE'] == 3 ? 'selected' : ''?>>[模式①]花呗转账</option>
                           <option value="4" <?=$this->userrow['INPUTFREE'] == 4 ? 'selected' : ''?>>[模式②]蚂蚁森林转账</option>
                           <option value="5" <?=$this->userrow['INPUTFREE'] == 5 ? 'selected' : ''?>>[模式③]滴滴转账</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">订单超时时间(秒)</label>
                <div class="layui-input-block">
                    <input type="text" name="outtime"  placeholder="请输入订单超时时间" value="<?=$this->userrow['outtime']?>" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">会员过期提醒</label>
                <div class="layui-input-block">
                    <select name="vip_mail" default="">
                           <option value="0" <?=$this->userrow['vip_mail'] == 0 ? 'selected' : ''?>>关闭</option>
                           <option value="1" <?=$this->userrow['vip_mail'] == 1 ? 'selected' : ''?>>开启</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">额度低预警</label>
                <div class="layui-input-block">
                    <select name="money_mail" default="">
                           <option value="0" <?=$this->userrow['money_mail'] == 0 ? 'selected' : ''?>>关闭</option>
                           <option value="1" <?=$this->userrow['money_mail'] == 1 ? 'selected' : ''?>>开启</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">接口模式</label>
                <div class="layui-input-block">
                    <select name="api_mode" default="">
                           <option value="1" <?=$this->userrow['api_mode'] == 1 ? 'selected' : ''?>>常规接口</option>
                           <option value="2" <?=$this->userrow['api_mode'] == 2 ? 'selected' : ''?>>RSA加签算法</option>
                    </select>
                </div>
            </div>
        </div>
        <!-- 提交按钮区域 -->
        <div style="text-align: center; margin-top: 30px;">
            <button class="btn-submit" lay-submit lay-filter="formsubmit">保存修改</button>
        </div>
        <br>
        </form>
        <div class="section-block">
            <div class="section-title">
                接口密钥<span class="subtitle">API对接必要参数</span>   
            </div>
            
            <div class="key-container">
                <?php if(!$paypwd):?>
                    <div class="empty-state" id="intepaypwd">
                        <i class="layui-icon layui-icon-password"></i>
                        <p>请先验证支付密码</p>
                    </div>
                <?php else:?>
                <!-- 基础信息卡片 -->
                <div class="key-card">
                    <div class="key-header">
                        <div class="key-title"><i class="layui-icon layui-icon-link"></i>
                            <span>基础接口信息</span>
                        </div>
                    </div>
                    <div class="key-body">
                        <div class="key-item">
                            <div class="key-label">对接接口</div>
                            <div class="key-value">
                                <span class="value-text"><?=$this->httphost.$host?></span>
                        <button class="copy-btn" data-clipboard-text="<?=$this->httphost.$host?>">
                                    <i class="layui-icon layui-icon-file btn" title="复制"></i>
                                    
                                </button>
                            </div>
                        </div>
                        <div class="key-item">
                            <div class="key-label">商户PID</div><div class="key-value">
                                <span class="value-text"><?=$this->userrow['pid']?></span><button class="copy-btn" data-clipboard-text="<?=$this->userrow['pid']?>">
                                    <i class="layui-icon layui-icon-file" title="复制"></i>
                                    
                                </button>
                            </div>
                        </div>
                        
                        <div class="key-item"><div class="key-label">商户KEY</div>
                            <div class="key-value">
                                <span class="value-text"><?=$this->userrow['key']?></span><div class="key-actions">
                                    <button class="copy-btn" data-clipboard-text="<?=$this->userrow['key']?>">
                                        <i class="layui-icon layui-icon-file" title="复制"></i>
                                        
                                    </button><button class="reset-btn" lay-submit lay-filter="resetKey">
                                        <i class="layui-icon layui-icon-refresh"></i>
                                        
                                    </button>
                                </div>
                            </div>
                        </div>
                        <?php if($this->userrow['api_mode'] == 2):?>
                            <div class="key-item"><div class="key-label">加解密KEY</div>
                                <div class="key-value">
                                    <span class="value-text"><?=$rsakey?></span><div class="key-actions">
                                        <button class="copy-btn" data-clipboard-text="<?=$rsakey?>">
                                            <i class="layui-icon layui-icon-file" title="复制"></i>
                                            
                                        </button><button class="reset-btn" lay-submit lay-filter="resetKey">
                                            <i class="layui-icon layui-icon-refresh"></i>
                                            
                                        </button>
                                    </div>
                                </div>
                            </div>
                        <?php endif;?>
                    </div>
                </div>
        
                <!-- RSA密钥卡片 -->
                <?php if($this->userrow['api_mode'] == 2): ?>
                <div class="key-card">
                    <div class="key-header">
                        <div class="key-title"><i class="layui-icon layui-icon-password"></i>
                            <span>RSA密钥</span>
                        </div><button class="layui-btn layui-btn-primary layui-btn-sm" lay-submit lay-filter="generateRsaKeys" ><i class="layui-icon <?php echo empty($this->userrow['rsapublickey']) ? 'layui-icon-add-1' : 'layui-icon-refresh'; ?>"></i>
                            <?php echo empty($this->userrow['rsapublickey']) ? '生成密钥' : '更新密钥'; ?>
                        </button>
                    </div>
                    <?php if(!empty($this->userrow['rsapublickey'])): ?>
                    <div class="key-body">
                        <div class="key-item">
                            <div class="key-label">公钥</div><div class="key-value">
                                <textarea class="key-textarea" readonly><?=$this->userrow['rsapublickey']?></textarea>
                                <button class="copy-btn" data-clipboard-text="<?=$this->userrow['rsapublickey']?>">
                                    <i class="layui-icon layui-icon-file" title="复制"></i>
                                    
                                </button>
                            </div>
                        </div>
                    </div>
                    <?php else: ?>
                        <div class="empty-state">
                            <i class="layui-icon layui-icon-password"></i>
                            <p>未生成RSA密钥 未生成会导致发起失败</p>
                        </div>
                    <?php endif; ?>
                </div>
                <?php endif; ?>
            <?php endif; ?>
            </div>
        </div>
        <div class="section-block">
            <div class="section-title">
                常见问题说明
                <span class="subtitle">使用过程中的疑难解答</span>
            </div>
            
            <div class="qa-container">
                <!-- 接口模式说明 -->
                <div class="qa-card">
                    <div class="qa-header">
                        <i class="layui-icon layui-icon-template"></i>
                        <span>接口模式对比</span>
                    </div>
                    <div class="qa-body">
                        <div class="qa-warning">
                            <i class="layui-icon layui-icon-tips"></i>
                            1.选择某种接口模式后将禁用另一种模式的相关功能（如发起支付、API申请提现等）如未使用过 rsa加签算法 则需要接口密钥里面生成<br>
                            2.RSA加签是需要两个key的 如找人对接请提供两个key 否则 会造成  对接失败 如 签名错误或token获取失败等问题
                        </div>
                        <div class="qa-item">
                            <div class="qa-label">常规接口</div>
                            <div class="qa-desc">
                                采用普遍的MD5验签算法
                                <div class="qa-tags">
                                    <span class="qa-tag">安全性较低</span><span class="qa-tag success">对接简单</span></div>
                            </div>
                        </div>
                        <div class="qa-item"><div class="qa-label">RSA加签算法</div><div class="qa-desc">
                                采用AES256和RSA合并加密，生成公钥私钥对接<div class="qa-tags">
                                    <span class="qa-tag success">安全性较高</span>
                                    <span class="qa-tag warning">对接复杂</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="qa-card">
                    <div class="qa-header">
                        <i class="layui-icon layui-icon-vercode"></i>
                        <span>重置key说明</span>
                    </div>
                    <div class="qa-body">
                        <div class="qa-desc">
                            <i class="layui-icon layui-icon-about"></i>
                            重置后 如果您使用的RSA效验 重置两个key任意一个 都会一起重置 请注意
                        </div>
                    </div>
                </div>
                <div class="qa-card">
                    <div class="qa-header">
                        <i class="layui-icon layui-icon-vercode"></i>
                        <span>支付密码说明</span>
                    </div>
                    <div class="qa-body">
                        <div class="qa-desc">
                            <i class="layui-icon layui-icon-about"></i>
                            如未设置支付密码则默认是你的登录密码(第一次的登录密码也就是注册时的密码) 建议单独设置
                        </div>
                    </div>
                </div>
                <div class="qa-card">
                    <div class="qa-header">
                        <i class="layui-icon layui-icon-vercode"></i>
                        <span>订单超时时间设置说明</span>
                    </div>
                    <div class="qa-body">
                        <div class="qa-desc">
                            <i class="layui-icon layui-icon-about"></i>
                            如不设置默认"240"秒,5分钟超时请填写"300" 以此类推 不建议太长
                        </div>
                    </div>
                </div>
                <div class="qa-card">
                    <div class="qa-header">
                        <i class="layui-icon layui-icon-vercode"></i>
                        <span>额度低预警</span>
                    </div>
                    <div class="qa-body">
                        <div class="qa-desc">
                            <i class="layui-icon layui-icon-about"></i>
                            开启后 会在 低于订单金额时发起通知
                        </div>
                    </div>
                </div>
                <div class="qa-card">
                    <div class="qa-header">
                        <i class="layui-icon layui-icon-vercode"></i>
                        <span>RSA私钥</span>
                    </div>
                    <div class="qa-body">
                        <div class="qa-desc">
                            <i class="layui-icon layui-icon-about"></i>
                            RSA私钥仅在生成时展示 关闭后 将不会 展示 请注意保存
                        </div>
                    </div>
                </div>
            </div>
        </div>
</div>
<script src="<?=userassets?>component/layui/layui.js"></script>
<script src="<?=userassets?>component/pear/pear.js"></script>
<script src="<?=ClipboardJS?>"></script>
<script src="<?=userassets?>core_js/info.js?v=<?=time()?>"></script>

</body>
</html>